/*
 * ====================================================================
 *
 *  Licensed to the Apache Software Foundation (ASF) under one or more
 *  contributor license agreements.  See the NOTICE file distributed with
 *  this work for additional information regarding copyright ownership.
 *  The ASF licenses this file to You under the Apache License, Version 2.0
 *  (the "License"); you may not use this file except in compliance with
 *  the License.  You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 *  Unless required by applicable law or agreed to in writing, software
 *  distributed under the License is distributed on an "AS IS" BASIS,
 *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 *  See the License for the specific language governing permissions and
 *  limitations under the License.
 * ====================================================================
 *
 * This software consists of voluntary contributions made by many
 * individuals on behalf of the Apache Software Foundation.  For more
 * information on the Apache Software Foundation, please see
 * <http://www.apache.org/>.
 *
 */

package cn.com.hbhgkj.util;

import java.io.IOException;
import java.nio.charset.Charset;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.Date;
import java.util.List;
import java.util.regex.Matcher;
import java.util.regex.Pattern;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.apache.http.HttpEntity;
import org.apache.http.HttpHost;
import org.apache.http.HttpResponse;
import org.apache.http.NameValuePair;
import org.apache.http.client.ClientProtocolException;
import org.apache.http.client.entity.UrlEncodedFormEntity;
import org.apache.http.client.methods.HttpGet;
import org.apache.http.client.methods.HttpPost;
import org.apache.http.conn.params.ConnRoutePNames;
import org.apache.http.impl.client.DefaultHttpClient;
import org.apache.http.message.BasicNameValuePair;
import org.apache.http.util.EntityUtils;

import cn.com.hbhgkj.ApplicationFormType;
import cn.com.hbhgkj.Constants;
import cn.com.hbhgkj.model.CopyrightApplication;
import cn.com.hbhgkj.model.CopyrightRegisteration;
import cn.com.hbhgkj.model.Copyrighter;
import cn.com.hbhgkj.service.ApplicationSendException;
import cn.com.hbhgkj.service.SynchronizeException;

public class CopyrightSender {
	static final String Encoding = "GB2312";
	static final String fnumRegex = "\\d{4}R[14]1L\\d{6}";
	static DefaultHttpClient httpclient = new DefaultHttpClient();
	static String loginPostUrl = "http://www.ccopyright.com.cn/cms/WebuserAction.do?method=login";
	static String getUrl = "http://www.ccopyright.com.cn/cms/getRegFormList.do";

	public static String regPostUrl = "http://www.ccopyright.com.cn/cms/saveSoftApplyingForm.do?fck=true";

	public static String r41PostUrl = "http://www.ccopyright.com.cn/cms/saveSoftItemChange.do?fck=true";
	static String confirmRegPostUrl = "http://www.ccopyright.com.cn/cms/submitApplyInfo.do?type=R11&fnum=";

	static {
		if (Constants.USE_PROXY) {
			HttpHost proxy = new HttpHost(Constants.PROXY_SERVER_HOST, Constants.PROXY_SERVER_PORT, Constants.PROXY_SERVER_SCHEMA);
			httpclient.getParams().setParameter(ConnRoutePNames.DEFAULT_PROXY,
					proxy);
		}
	}

	public static String send(List<NameValuePair> params, String url)
			throws ApplicationSendException {
		HttpPost httpPost = new HttpPost(url);
		try {
			UrlEncodedFormEntity formEntity = new UrlEncodedFormEntity(params,
					Encoding);
			// System.out.println(EntityUtils.toString(formEntity,
			// Charset.forName(Encoding)));
			httpPost.setEntity(formEntity);

			HttpResponse response2 = httpclient.execute(httpPost);

			LOG.info("-----------Regist status line:"
					+ response2.getStatusLine());
			HttpEntity entity2 = response2.getEntity();
			// do something useful with the response body
			// and ensure it is fully consumed
			Charset cs = Charset.forName(Encoding);
			String respText = EntityUtils.toString(entity2, cs);
			LOG.info("-----------Response Text:" + respText);
			Pattern p = Pattern.compile(fnumRegex);
			Matcher m = p.matcher(respText);
			String fnum = "";
			while (m.find()) {
				fnum = m.group();
			}
			LOG.info("-----------Regist serialNumber:" + fnum);
			EntityUtils.consume(entity2);
			return fnum;
		} catch (Exception e) {
			throw new ApplicationSendException("官网无法上传，请稍后上传!");
		} finally {
			httpPost.releaseConnection();
		}
	}

	public static String registCopyRight(CopyrightApplication copyright)
			throws ClientProtocolException, IOException {
		LOG.info("---------------------Regist-------------------");
		HttpPost httpPost = new HttpPost(regPostUrl);

		List<NameValuePair> nvps = new ArrayList<NameValuePair>();
		nvps.add(new BasicNameValuePair("agentDesc", copyright.getAgentDesc()));//
		nvps.add(new BasicNameValuePair("appearAreaCity", copyright
				.getAppearAreaCity()));// 首次发表地点 城市
		nvps.add(new BasicNameValuePair("appearAreaCountry", copyright
				.getAppearAreaCountry()));// 首次发表地点 国家
		nvps.add(new BasicNameValuePair("appearDate", copyright.getAppearDate()));// 首次发表时间
		nvps.add(new BasicNameValuePair("applyType", copyright.getApplyType()));// 申请方式
		nvps.add(new BasicNameValuePair("belongType0", copyright
				.getBelongType0()));//
		Copyrighter[] cts = copyright.getCopyrighters();

		for (Copyrighter each : cts) {
			nvps.add(new BasicNameValuePair("busType1", each.getBusType()));// 企业类别
			nvps.add(new BasicNameValuePair("city1", each.getCity()));//

			nvps.add(new BasicNameValuePair("country1", each.getCountry()));//
			nvps.add(new BasicNameValuePair("garden1", each.getGarden()));// 园区
			nvps.add(new BasicNameValuePair("idNumber1", each.getIdNumber()));// 证件号码
			nvps.add(new BasicNameValuePair("idTypes1", String.valueOf(each
					.getIdType())));// 证件类型
			nvps.add(new BasicNameValuePair("name1", ""));// 著作权人姓名
			nvps.add(new BasicNameValuePair("province1", each.getProvince()));// 省份
			nvps.add(new BasicNameValuePair("peopleType1", each.getPeopleType()));// 著作权人
																					// 类别
		}

		nvps.add(new BasicNameValuePair("dailr", copyright.getDailr()));//
		nvps.add(new BasicNameValuePair("completeDate", copyright
				.getCompleteDate()));//
		nvps.add(new BasicNameValuePair("developCircs", copyright
				.getDevelopCircs()));// 软件作品说明
		nvps.add(new BasicNameValuePair("developMode", copyright
				.getDevelopMode()));//
		nvps.add(new BasicNameValuePair("difmatKeepPages", copyright
				.getDifmatKeepPages()));//
		nvps.add(new BasicNameValuePair("difmatReferMode", copyright
				.getDifmatReferMode()));//
		nvps.add(new BasicNameValuePair("dlraddress", copyright.getDlraddress()));// 代理人开始
		nvps.add(new BasicNameValuePair("dlrcontactPerson", copyright
				.getDlrcontactPerson()));//
		nvps.add(new BasicNameValuePair("dlremail", copyright.getDlremail()));//
		nvps.add(new BasicNameValuePair("dlrfax", copyright.getDlrfax()));//
		nvps.add(new BasicNameValuePair("dlrmobile", copyright.getDlrmobile()));//
		nvps.add(new BasicNameValuePair("dlrname", copyright.getDlrname()));//
		nvps.add(new BasicNameValuePair("dlrphone", copyright.getDlrphone()));//
		nvps.add(new BasicNameValuePair("dlrpostCode", copyright
				.getDlrpostCode()));// 代理人结束
		nvps.add(new BasicNameValuePair("editionNumber", copyright
				.getEditionNumber()));// 版本号

		nvps.add(new BasicNameValuePair("hardwareEnv", copyright
				.getHardwareEnv()));// 硬件环境
		nvps.add(new BasicNameValuePair("hasLetter1", copyright.getHasLetter1()));// 申请证书副本

		nvps.add(new BasicNameValuePair("isMutilDoc", copyright.getIsMutilDoc()));// 一种文档
		nvps.add(new BasicNameValuePair("kind", copyright.getKind()));// 登记类型
		nvps.add(new BasicNameValuePair("loginId", copyright.getLoginId()));//
		nvps.add(new BasicNameValuePair("mutilDocType", copyright
				.getMutilDocType()));// 多种文档种类

		nvps.add(new BasicNameValuePair("origRegisterNumber", copyright
				.getOrigRegisterNumber()));// 原登记号
		nvps.add(new BasicNameValuePair("origSoftModifyDescription", copyright
				.getOrigSoftModifyDescription()));// 修改合成或翻译说明

		nvps.add(new BasicNameValuePair("programLanguage", copyright
				.getProgramLanguage()));//
		nvps.add(new BasicNameValuePair("proveFile", copyright.getProveFile()));//

		nvps.add(new BasicNameValuePair("publishStatus", copyright
				.getPublishStatus()));// 发表状态
		nvps.add(new BasicNameValuePair("rightObtainMode", copyright
				.getRightObtainMode()));// 权利取得方式
		nvps.add(new BasicNameValuePair("rightScope", copyright.getRightScope()));// 权利范围
		nvps.add(new BasicNameValuePair("rightScopePart", copyright
				.getRightScopePart()));// 权利范围－部分
		nvps.add(new BasicNameValuePair("shenqr", copyright.getShenqr()));//
		nvps.add(new BasicNameValuePair("softForShort", copyright
				.getSoftForShort()));// 软件简称
		nvps.add(new BasicNameValuePair("softFullName", copyright
				.getSoftFullName()));// 软件名称
		nvps.add(new BasicNameValuePair("softFunctionAndSpecialty", copyright
				.getSoftFunctionAndSpecialty()));// 主要功能和技术特点
		nvps.add(new BasicNameValuePair("softNumber", copyright.getSoftNumber()));// 分类号
		nvps.add(new BasicNameValuePair("softwareEnv", copyright
				.getSoftwareEnv()));// 软件环境
		nvps.add(new BasicNameValuePair("sourceCodeCapacity", copyright
				.getSourceCodeCapacity()));// 源程序量
		nvps.add(new BasicNameValuePair("sqraddress", copyright.getSqraddress()));// 详细地址
		nvps.add(new BasicNameValuePair("sqrcontactPerson", copyright
				.getSqrcontactPerson()));// 联系人
		nvps.add(new BasicNameValuePair("sqremail", copyright.getSqremail()));//
		nvps.add(new BasicNameValuePair("sqrfax", copyright.getSqrfax()));//
		nvps.add(new BasicNameValuePair("sqrmobile", copyright.getSqrmobile()));//
		nvps.add(new BasicNameValuePair("sqrname", copyright.getSqrname()));// 姓名或单位名称
		nvps.add(new BasicNameValuePair("sqrphone", copyright.getSqrphone()));//
		nvps.add(new BasicNameValuePair("sqrpostCode", copyright
				.getSqrpostCode()));//

		UrlEncodedFormEntity formEntity = new UrlEncodedFormEntity(nvps,
				Encoding);
		System.out.println(EntityUtils.toString(formEntity,
				Charset.forName(Encoding)));
		httpPost.setEntity(formEntity);

		HttpResponse response2 = httpclient.execute(httpPost);

		try {
			LOG.info("-----------Regist status line:"
					+ response2.getStatusLine());
			HttpEntity entity2 = response2.getEntity();
			// do something useful with the response body
			// and ensure it is fully consumed
			Charset cs = Charset.forName(Encoding);
			String respText = EntityUtils.toString(entity2, cs);
			LOG.info("-----------Response Text:" + respText);
			Pattern p = Pattern.compile(fnumRegex);
			Matcher m = p.matcher(respText);
			String fnum = "";
			while (m.find()) {
				fnum = m.group();
			}
			LOG.info("-----------Regist serialNumber:" + fnum);
			EntityUtils.consume(entity2);
			return fnum;
		} finally {
			httpPost.releaseConnection();
		}
	}

	public static List<CopyrightRegisteration> getData(String startDate,
			String endDate) throws SynchronizeException {

		List<CopyrightRegisteration> result = new ArrayList<CopyrightRegisteration>();

		CopyrightRegisteration cr = null;

		String args = "?&sql_name=&sql_obligee=&sql_num=&curPage=1&count=10000&sortOrder=desc&sortLabel=createDate";
		args += "&sql_startDate=" + startDate;
		args += "&sql_endDate=" + endDate;
		System.out.println(getUrl + args);
		HttpGet httpGet = new HttpGet(getUrl + args);
		try {
			HttpResponse response = httpclient.execute(httpGet);
			String seriaNumRegx = "\\d{4}R[14]1L\\d{6}</a>";
			String copyrighterRegx = "<tdclass=\"datacell\">[^<>]*</td>";
			String nameRegx = "<spanclass=\"suporsub\">.*</span>";// [\\t\\n\\s\\S]*?</span>";
			String regDateRegx = "(\\d{4}-\\d{2}-\\d{2})</td>";

			HttpEntity responseEntity = response.getEntity();
			long b = Calendar.getInstance().getTimeInMillis();

			if (responseEntity != null) {
				String respText = EntityUtils
						.toString(responseEntity, Charset.forName("UTF-8"))
						.replaceAll(" ", "").replaceAll("\t", "")
						.replaceAll("\r\n", "");

				String[] trs = respText.split("<tr>");

				for (String each : trs) {
					if (each.contains("datacell")
							&& !regularGroup(seriaNumRegx, each).equals("")) {
						cr = new CopyrightRegisteration();
						// seriaNum
						String strGet = regularGroup(seriaNumRegx, each);
						cr.setSerialNum(strGet.substring(0,
								strGet.indexOf("</a>")));
						// System.out.println("SeriaNum:" +
						// strGet.substring(0,strGet.indexOf("</a>")));

						strGet = regularGroup(copyrighterRegx, each);
						// System.out.println("Copyrighter:" +
						// strGet.substring(strGet.indexOf(">") +
						// 1,strGet.indexOf("</td>")));
						cr.setCopyrighter(strGet.substring(
								strGet.indexOf(">") + 1,
								strGet.indexOf("</td>")));

						strGet = regularGroup(nameRegx, each);
						// System.out.println("Name:" +
						// strGet.substring(strGet.indexOf(")\">") +
						// 3,strGet.indexOf("</a>")));
						cr.setProductName(strGet.substring(
								strGet.indexOf(")\">") + 3,
								strGet.indexOf("</a>")));

						strGet = regularGroup(regDateRegx, each);

						// System.out.println("RegDate:" +
						// strGet.substring(0,strGet.indexOf("</td>")));
						cr.setRegistDate(strGet.substring(0,
								strGet.indexOf("</td>")));

						cr.setApplyFormType(getApplicationFormType(cr
								.getSerialNum()));

						result.add(cr);

					}
				}

				/*
				 * System.out.println("Response： " + respText); Set<String> set
				 * = new HashSet<String>(); Pattern p =
				 * Pattern.compile(fnumRegex); Matcher m = p.matcher(respText);
				 * while (m.find()) { set.add(m.group()); }
				 */
				/*
				 * System.out.println("集合大小为： " + set.size());
				 * System.out.println("子串内容为： " + set);
				 */
			}
			long e = Calendar.getInstance().getTimeInMillis();
			System.out.println("解析花费： " + (e - b) + "毫秒。");
			EntityUtils.consume(responseEntity);
			return result;
		} catch (Exception e) {
			throw new SynchronizeException(e.getMessage());
		} finally {
			httpGet.releaseConnection();
		}
	}

	private static int getApplicationFormType(String seriaNum) {
		int result = -1;
		if (seriaNum.contains("R11"))
			result = ApplicationFormType.R11.getValue();

		if (seriaNum.contains("R41"))
			result = ApplicationFormType.R41.getValue();
		return result;
	}

	// 传入2个字符串参数 一个是pattern(我们使用的正则) 另一个matcher是html源代码
	private static String regularGroup(String pattern, String matcher) {
		Pattern p = Pattern.compile(pattern, Pattern.CASE_INSENSITIVE);
		Matcher m = p.matcher(matcher);
		if (m.find()) { // 如果读到
			return m.group();// 返回捕获的数据
		} else {
			return ""; // 否则返回一个空值
		}
	}

	public static void login(String loginId, String password)
			throws ApplicationSendException {
		LOG.info("------------------Login----------------------");
		HttpPost httpPost = new HttpPost(loginPostUrl);
		try {
			List<NameValuePair> nvps = new ArrayList<NameValuePair>();
			nvps.add(new BasicNameValuePair("loginId", loginId));
			nvps.add(new BasicNameValuePair("password", password));
			httpPost.setEntity(new UrlEncodedFormEntity(nvps));
			HttpResponse response2 = httpclient.execute(httpPost);

			LOG.info("Login response status line:" + response2.getStatusLine());
			HttpEntity entity2 = response2.getEntity();

			/*
			 * Charset cs = Charset.forName(Encoding); String respText =
			 * EntityUtils.toString(entity2, cs);
			 */
			// do something useful with the response body
			// and ensure it is fully consumed
			// EntityUtils.consume(entity2);
		} catch (Exception e) {
			throw new ApplicationSendException("官网无法上传，请稍后上传!");
		} finally {
			httpPost.releaseConnection();
		}
	}

	private static final Log LOG = LogFactory.getLog(CopyrightSender.class);

	public static String testRegistCopyRight() throws ClientProtocolException,
			IOException {
		LOG.info("---------------------Regist-------------------");
		HttpPost httpPost = new HttpPost(regPostUrl);

		List<NameValuePair> nvps = new ArrayList<NameValuePair>();
		nvps.add(new BasicNameValuePair("agentDesc", "adfasdfdsf"));//
		nvps.add(new BasicNameValuePair("appearAreaCity", "asdfad"));// 首次发表地点
																		// 城市
		nvps.add(new BasicNameValuePair("appearAreaCountry", "asdfasd"));// 首次发表地点
																			// 国家
		nvps.add(new BasicNameValuePair("appearDate", "2012-09-13"));// 首次发表时间

		nvps.add(new BasicNameValuePair("applyType", "代理人"));// 申请方式
		nvps.add(new BasicNameValuePair("belongType0", "著作权人"));//
		nvps.add(new BasicNameValuePair("shenqr", "申请人"));//
		nvps.add(new BasicNameValuePair("kind", "R11"));// 登记类型
		nvps.add(new BasicNameValuePair("dailr", "代理人"));//

		nvps.add(new BasicNameValuePair("busType1", "集体企业"));// 企业类别
		nvps.add(new BasicNameValuePair("city1", "sdfsd"));//

		nvps.add(new BasicNameValuePair("country1", "中国"));//
		nvps.add(new BasicNameValuePair("garden1", "清华软件园"));// 园区
		nvps.add(new BasicNameValuePair("idNumber1", "2342342"));// 证件号码
		nvps.add(new BasicNameValuePair("idTypes1", "1"));// 证件类型
		nvps.add(new BasicNameValuePair("name1", ""));// 著作权人姓名
		nvps.add(new BasicNameValuePair("province1", "asdfasd"));// 省份
		nvps.add(new BasicNameValuePair("peopleType1", "1"));// 著作权人 类别

		nvps.add(new BasicNameValuePair("completeDate", "2012-09-09"));//
		nvps.add(new BasicNameValuePair("developCircs", "1"));// 软件作品说明
		nvps.add(new BasicNameValuePair("developMode", "1"));//
		nvps.add(new BasicNameValuePair("difmatKeepPages", "0"));//
		nvps.add(new BasicNameValuePair("difmatReferMode", "1"));//
		nvps.add(new BasicNameValuePair("dlraddress", Constants.AGENT_ADDRESS));// 代理人开始
		nvps.add(new BasicNameValuePair("dlrcontactPerson",
				Constants.AGENT_CONTACT));//
		nvps.add(new BasicNameValuePair("dlremail", Constants.AGENT_EMAIL));//
		nvps.add(new BasicNameValuePair("dlrfax", Constants.AGENT_FAX));//
		nvps.add(new BasicNameValuePair("dlrmobile", Constants.AGENT_MOBILE));//
		nvps.add(new BasicNameValuePair("dlrname", Constants.AGENT_NAME));//
		nvps.add(new BasicNameValuePair("dlrphone", Constants.AGENT_PHONE));//
		nvps.add(new BasicNameValuePair("dlrpostCode", Constants.AGENT_POSTCODE));// 代理人结束
		nvps.add(new BasicNameValuePair("editionNumber", "10234"));// 版本号

		nvps.add(new BasicNameValuePair("hardwareEnv", "asdfasd"));// 硬件环境
		nvps.add(new BasicNameValuePair("hasLetter1", ""));// 申请证书副本

		nvps.add(new BasicNameValuePair("isMutilDoc", "oneDoc"));// 一种文档

		nvps.add(new BasicNameValuePair("loginId", Constants.AGENT_USERNAME));//
		nvps.add(new BasicNameValuePair("mutilDocType", "0"));// 多种文档种类

		nvps.add(new BasicNameValuePair("origRegisterNumber", "231234"));// 原登记号
		nvps.add(new BasicNameValuePair("origSoftModifyDescription", "asdfas"));// 修改合成或翻译说明

		nvps.add(new BasicNameValuePair("programLanguage", "c#"));//
		nvps.add(new BasicNameValuePair("proveFile", ""));//

		nvps.add(new BasicNameValuePair("publishStatus", "1"));// 发表状态
		nvps.add(new BasicNameValuePair("rightObtainMode", "1"));// 权利取得方式
		nvps.add(new BasicNameValuePair("rightScope", "1"));// 权利范围
		nvps.add(new BasicNameValuePair("rightScopePart", ""));// 权利范围－部分

		nvps.add(new BasicNameValuePair("softForShort", "test"));// 软件简称
		nvps.add(new BasicNameValuePair("softFullName", "test"));// 软件名称
		nvps.add(new BasicNameValuePair("softFunctionAndSpecialty", "asdfadf"));// 主要功能和技术特点
		nvps.add(new BasicNameValuePair("softNumber", "21431"));// 分类号
		nvps.add(new BasicNameValuePair("softwareEnv", "asdfasd"));// 软件环境
		nvps.add(new BasicNameValuePair("sourceCodeCapacity", "23421"));// 源程序量
		nvps.add(new BasicNameValuePair("sqraddress", "adadf"));// 详细地址
		nvps.add(new BasicNameValuePair("sqrcontactPerson", "sdfgsdfg"));// 联系人
		nvps.add(new BasicNameValuePair("sqremail", "adf@sina.com"));//
		nvps.add(new BasicNameValuePair("sqrfax", "214234"));//
		nvps.add(new BasicNameValuePair("sqrmobile", "125424352"));//
		nvps.add(new BasicNameValuePair("sqrname", "asdfasdf"));// 姓名或单位名称
		nvps.add(new BasicNameValuePair("sqrphone", "234134"));//
		nvps.add(new BasicNameValuePair("sqrpostCode", "12341234123"));//

		UrlEncodedFormEntity formEntity = new UrlEncodedFormEntity(nvps,
				Encoding);
		System.out.println(EntityUtils.toString(formEntity,
				Charset.forName(Encoding)));
		httpPost.setEntity(formEntity);

		HttpResponse response2 = httpclient.execute(httpPost);

		try {
			LOG.info("-----------Regist status line:"
					+ response2.getStatusLine());
			HttpEntity entity2 = response2.getEntity();
			// do something useful with the response body
			// and ensure it is fully consumed
			Charset cs = Charset.forName(Encoding);
			String respText = EntityUtils.toString(entity2, cs);
			LOG.info("-----------Response Text:" + respText);
			Pattern p = Pattern.compile(fnumRegex);
			Matcher m = p.matcher(respText);
			String fnum = "";
			while (m.find()) {
				fnum = m.group();
			}
			LOG.info("-----------Regist serialNumber:" + fnum);
			EntityUtils.consume(entity2);
			return fnum;
		} finally {
			httpPost.releaseConnection();
		}
	}

	public static void main(String[] args) throws Exception { // 测试取得流水号

		/*
		 * HttpHost proxy = new HttpHost("10.24.1.7", 3128, "http");
		 * httpclient.getParams().setParameter(ConnRoutePNames.DEFAULT_PROXY,
		 * proxy);
		 */
		/* httpclient.getConnectionManager(). */
		// login("hbsia88710710", "8871071088710577"); // getData(); // 测试注册R11
		login("hust_li", "q1w2e3r4");

		/* testRegistCopyRight(); */

		List<CopyrightRegisteration> data = CopyrightSender.getData(
				DateUtil.getCurDate(),
				DateUtil.getSpecifiedDayAfter(new Date().toLocaleString()));
		/*
		 * List result = CopyrightSender.getData("2012-12-01",
		 * DateUtils.getSpecifiedDayAfter(new Date().toLocaleString()));
		 */
		System.out.println("-----------");
	}

}
